home *** CD-ROM | disk | FTP | other *** search
/ Programming Sound Cards / Programming Sound Cards.iso / sound_00 / powdemo2.bas < prev    next >
BASIC Source File  |  1995-01-01  |  2KB  |  102 lines

  1. $string 32
  2. $link "pow.pbl"
  3. $include "pow.inc"
  4.  
  5.  
  6. cls:print
  7. print "POW! Library for PowerBASIC 3.0
  8. print "(C) Copyright 1994 by Tim Gerchmez"
  9. print:print "Demo Program #2":print"---------------":print
  10. print "This program demonstrates the SBCMF routines, which"
  11. print "use SBFMDRV.COM to play .CMF files in the background."
  12. print "SBFMDRV.COM must be loaded before running this demo."
  13. print
  14.  
  15. if sbcmfdetect=0 then
  16.     print:print "Please load SBFMDRV.COM, then rerun this program."
  17.      print:end
  18. end if
  19. line input ".CMF Directory (ENTER alone for current): ";c$
  20. olddir$=curdir$
  21. if c$="" then goto looppoint
  22. chdir c$
  23.  
  24. looppoint:
  25. print
  26. files "*.CMF"
  27. print
  28. line input "CMF File to Play (.CMF not required): ";fl$
  29. if fl$="" then chdir olddir$:end
  30. fl$=ucase$(fl$)
  31. if right$(fl$,4)<>".CMF" then fl$=fl$+".CMF"
  32. if dir$(fl$)="" then print "No File ";fl$:goto looppoint
  33. redim ary%(1:32767)
  34. sbcmfplay fl$,ary%(1)
  35. spd%=0:xpz%=0
  36. print:print "Playing ";fl$;" -"
  37. print
  38. print "Press P to Pause Song"
  39. print "Press R to Resume Song"
  40. print "Press C to Cancel Song"
  41. print "Press +/= to Increase Speed"
  42. print "Press - to Decrease Speed
  43. print "Press U to Transpose Up"
  44. print "Press D to Transpose Down"
  45. print "Press SPACE to return to defaults"
  46. print "Press ENTER for another Song"
  47. print "Press ESC to end program"
  48. inlooppoint:
  49. if sbcmfcheck=0 then
  50.      while inkey$<>"":wend
  51.     print:print "Playback Ended - Press a Key..."
  52.      sleep:a$=inkey$
  53.      goto looppoint
  54. end if
  55. a$=inkey$:if a$="" then goto inlooppoint
  56. if a$=" " then
  57.     spd%=0:xpz%=0
  58.      sbcmfsetspeed spd%
  59.      sbcmftranspose xpz%
  60.      goto inlooppoint
  61. end if
  62. if a$="+" or a$="=" then
  63.     if spd%<64 then spd%=spd%+4
  64.      sbcmfsetspeed spd%
  65.      goto inlooppoint
  66. end if
  67. if a$="-" then
  68.     if spd%>-64 then spd%=spd%-4
  69.      sbcmfsetspeed spd%
  70.      goto inlooppoint
  71. end if
  72. if lcase$(a$)="u" then
  73.     if xpz%<13 then
  74.          xpz%=xpz%+1
  75.           sbcmftranspose xpz%
  76.          goto inlooppoint
  77.      end if
  78. end if
  79. if lcase$(a$)="d" then
  80.     if xpz%>-13 then
  81.          xpz%=xpz%-1
  82.           sbcmftranspose xpz%
  83.           goto inlooppoint
  84.      end if
  85. end if
  86. if lcase$(a$)="p" then
  87.     sbcmfpause:goto inlooppoint
  88. end if
  89. if lcase$(a$)="r" then
  90.     sbcmfresume:goto inlooppoint
  91. end if
  92. if lcase$(a$)="c" then
  93.     sbcmfcancel:goto inlooppoint
  94. end if
  95. if a$=chr$(13) then goto looppoint
  96. if a$=chr$(27) then
  97.     sbcmfcancel
  98.      chdir olddir$
  99.      end
  100. end if
  101. goto inlooppoint
  102.